﻿<Window x:Class="grafika4_1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:grafika4_1"
        Title="MainWindow" Height="600" Width="800" >
    <Window.Resources>
        <local:BrushSizeConverter x:Key="BrushSizeConverter"/>
        <local:BrushBrightnesValueConverter x:Key="BrushBrigthnesValueConverter"/>
        <local:BrushContrastValueConverter x:Key="BrushContrastValueConverter"/>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="200"/>
        </Grid.ColumnDefinitions>
        <Canvas Name="workSpace" Grid.Column="0" MouseMove="workSpace_MouseMove" MouseEnter="workSpace_MouseEnter" MouseLeave="workSpace_MouseLeave" MouseDown="workSpace_MouseDown">
            <Canvas.Background>
                <ImageBrush x:Name="image"/>
            </Canvas.Background>
            <Rectangle Name="rectangle" Width="{Binding ElementName=slrBrush, Path=Value,  Converter={StaticResource BrushSizeConverter}, ConverterParameter=20}" 
                       Height="{Binding ElementName=slrBrush, Path=Value,  Converter={StaticResource BrushSizeConverter}, ConverterParameter=20}"
                       Fill="DarkGray" Opacity="0.5"  Visibility="Hidden"/>
        </Canvas>
    
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Button Grid.Row="0" Name="btnChoseWallPaper" Content="Wybierz obrazek" Click="btnChoseWallPaper_Click"/>
            <Button Grid.Row="1" Name="btnBackImage" Content="Cofnij" Click="btnBackImage_Click"/>
                <Grid Grid.Row="3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70"/>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <RadioButton Name="rdbBrightness" GroupName="graph" Content="Jasność" IsChecked="True" Checked="radioButton_Checked" HorizontalAlignment="Left" Width="70" />
                <TextBlock Name="txtBrightnes" Grid.Column="1" Text="{Binding ElementName=slrBrightness, Path=Value, Converter={StaticResource BrushBrigthnesValueConverter}, ConverterParameter=510}"/>
                <Slider Grid.Column="2" Name="slrBrightness" Value="5"/>
                </Grid>
                <Grid Grid.Row="4">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70"/>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <RadioButton Grid.Column="0" Name="rdbContrast" GroupName="graph" Content="Kontrast" Checked="radioButton_Checked"/>
                <TextBlock Name="txtContrast" Grid.Column="1" Text="{Binding ElementName=slrContrast, Path=Value, Converter={StaticResource BrushContrastValueConverter}, ConverterParameter=255}"/>
                <Slider Grid.Column="2" Name="slrContrast" Value="5"/>
                </Grid>
                <Grid Grid.Row="5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70"/>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <RadioButton Grid.Column="0" Name="rdbOwn" GroupName="graph" Content="Własny" Checked="radioButton_Checked"/>
                <TextBlock Grid.Column="1" Text="{Binding ElementName=slrOwn, Path=Value}"/>
                <Slider Name="slrOwn" Grid.Column="2"/>
                </Grid>
                <Grid Grid.Row="6">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="70"/>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <CheckBox Name="chbBrush" Grid.Column="0" Checked="chbBrush_Checked">Pedzel</CheckBox>
                <TextBlock Name="txtBrush" Grid.Column="1" Text="{Binding ElementName=slrBrush, Path=Value,  Converter={StaticResource BrushSizeConverter}, ConverterParameter=20}"/>
                <Slider Grid.Column="2" Name="slrBrush"/>    
            </Grid>
            </Grid>
    </Grid>
</Window>
